#include <functional>
#include <iostream>
#include <vector>
#include<numeric>
//#include<pstl/glue_algorithm_impl.h>
#include<chrono>
#include<execution>
int main()
{
std::vector<double> v(1000'000'007, 0.5);

 
    {
        std::vector<double> r(1000'000'007);
        double result=0.0;
        auto t1 = std::chrono::high_resolution_clock::now();
        std::exclusive_scan(std::execution::par,v.begin(),v.end(),r.begin(),0.0);
        auto t2 = std::chrono::high_resolution_clock::now();
        std::chrono::duration<double, std::milli> ms = t2 - t1;
        std::cout << std::fixed << "std::exclusive_scan ,std::excution::par,result " << result
                  << " took " << ms.count() << " ms\n";
        r.clear();
    }	  
       {
        std::vector<double> r(1000'000'007);
        double result=0.0;
        auto t1 = std::chrono::high_resolution_clock::now();
        std::exclusive_scan(v.begin(),v.end(),r.begin(),0.0);
        auto t2 = std::chrono::high_resolution_clock::now();
        std::chrono::duration<double, std::milli> ms = t2 - t1;
        std::cout << std::fixed << "std::exclusive_scan result " << result
                  << " took " << ms.count() << " ms\n";
        r.clear();
    }    
}
// std::exclusive_scan ,std::excution::par,result 0.000000 took 1507.852889 ms
// std::exclusive_scan result 0.000000 took 993.270524 ms
// 还是变慢了